package com.fudan.adse.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.FutureOrPresent;
import javax.validation.constraints.Min;
import java.util.Date;

/**
 *
 * @author Jerry Zhang
 * create: 2022-11-25 18:59
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RowPieceDTO {
    private Integer id;
    @Min(value = 0, message = "影院 id 必须大于 0")
    private Integer cinemaId;
    @Min(value = 0, message = "影厅 id 必须大于 0")
    private Integer roomId;
    @Min(value = 0, message = "影片 id 必须大于 0")
    private Integer filmId;
    @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd'T'HH:mm:ss")
    @FutureOrPresent(message = "只能选择当前或未来的时间")
    private Date startTime;
    @Min(value = 0, message = "单价必须大于等于 0")
    private Double price;
}
